home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-08-26 | 7.7 KB | 171 lines | [ttro/ttxt] |
- rebeccaLib v0.03b2
- ©1995 Infant Software
- <a NKOTB production>
-
- COMMANDS
-
- filtermail(filterArray)
-
- A simple function that takes a single condition and filters mail based on it.
- The members of the filterArray parameter are as follows:
-
- {fromBox, toBox, searchString, criteria}
-
- displayFilter(path_to_rules, path_to_results)
-
- A more complex brother to filtermail. It filters based on multiple conditions and
- outputs the results to a file.
-
- path_to_rules should be the path to where you have stored your filter conditions
- (using the addCondition command that is described below). path_to_results is the
- path to a text file which is used to record the date on which mail was filtered
- as well as a record of how many messages where moved according to each condition.
- A sample results file would look like:
-
- Monday January 12, 1995 12:53 AM
- 5 messages moved from In to MyBigBox
- 2 messages moved from In to Trash
- 7 messages moved from In to MacPerlList
- 0 messages moved from In to MacEudoraForum
-
- Note, that both paths should be passed as strings, so if for example, the user of
- your script was to choose the path to each the script line should be:
-
- set path_to_rules to (choose file) as string
-
- addCondition(condition_to_add, path_to_rules)
-
- Adds a condition to your rules file.
-
- path_to_rules is a string that contains the path the file you have your filter
- conditions stored in. condition_to_add is a four member array. The order of
- members is the same as the filterArray parameter of the filtermail command.
- Each new condition is added at the beginning of the file. So the file acts as a
- stack; last on, first off. addCondition writes each condition to a file as text
- not as a list, so you can open your rules with BBEdit, Simple Text or whatever
- and make any changes you want. All files are written as follows:
-
- fromBox tab toBox tab searchString tab criteria return
-
- i.e. fromBox and a tab then the toBox et cetera.
-
- retrieveConditions(path_to_rules)
-
- Grabs the conditions from your rules file and returns them as an array.
-
- path_to_rules is a string that contains the path to the fiel you have your filter
- conditions stored in. The array returned by retreiveConditions is in turn broken
- down into a variable number of arrays of 4 members each. The number of these arrays
- is equal to the number of conditions in your rules file. Below is an example of an
- array returned form a file with two conditions stored in it:
-
- {{"In", "MacPerlList", "[MacPerl]", "subject"},{"MacEudoraForum", "Trash", "unsubs", "subject"}}
-
- To access individual members of each condition you need to specify both the member
- number and the condition number. For example to access the toBox of the first condition
- I would use something similar to:
-
- set my2box to item 2 of item 1 of array_returned
-
- removeCondition(ruleNumber, path_to_rules)
-
- path_to_rules is a string that contains the path to the fiel you have your filter
- conditions stored in. ruleNumber is the integer value of the condition you wish
- to remove. Remember that the file operates similar to a stack so that the last
- condition added to the file is rule number 1, the next to last rule number 2, et
- cetera.
-
- OPTIMIZING YOUR FILTERING
-
- Currently, rebeccaLib has a very primitive condition matching system. For each
- condition you have, it checks each message in the fromBox. This means, that if
- you have 4 conditions that filter mail from your In Box that each message is
- examined on each of four passes; assuming that it doesn't find a match on a
- previous pass and get moved. Therefore, your filtering will take less time if
- you place the conditons that move the most message at the beginning of your
- filterArray, have them added to your rules file last or use the reorder conditions
- command in HQ (see below) to move those conditions forward in the array.
-
- ABOUT THE SAMPLE SCRIPTS AND TOOLS
-
- Simple Filter
-
- Demonstrates how to use the filtermail command. It filters mail on a per condition/
- one shot basis.
-
- HQ
-
- HQ, or HeadQuarters, is your way to send orders to Nikita. Through HQ you can set
- the number of minutes between mail checks, temporarily Suspend Nikita's activities
- without quitting Nikita, resume said activities, enter/delete/reorder filter conditions, and
- filter mail without having to wait for mail to arrive.
- HQ makes use of two files:
- filter rules stores your filter rules as well as preferences you have set and settings HQ and Nikita
- set during the course of their operations. Its default location is in your preferences folder
- filter results is a listing of all activities undertaken by Nikita and HQ in regards to filtering mail.
- Its default location is in your Eudora Folder.
-
- Nikita
-
- Nikita is a stay open script i.e. 'an agent' that takes over from Eudora when it comes to
- checking for mail. When you launch Nikita, it reads in the number of minutes you have
- set in the Check Mail setting box and replaces it with "". Nikita then checks mail on that basis,
- if you wish to change the amount of time between checks, launch HQ and go to Preferences or
- quit out of Nikita and go into Eudora and change the time in your settings. N.B. when you quit
- Nikita, it sets the mail check time in Eudora to whatever Nikita was last set to. So, if for example
- you changed the time from 10 minutes to 15 minutes using HQ then, when you quit Nikita,
- Eudora's mail check time will be 15 minutes.
- When Nikita spies that mail has arrived, it immediately goes to work filtering the mail. When
- Nikita is done, it will inform you of that arrival. In addition, information as to exsactly what was
- done can be obtained from you filter results file as with HQ.
-
- Stop That!!!
-
- A simple program that will allow you to have Eudora stop notifying any application
- of when mail arrives. This is particularly useful if your machine crashes and doesn't
- allow Nikita to run its quit procedures. Just choose an application from the dialog
- box presented and Stop That!!! tell Eudora NOT to notify that application of mail
- arriving. If you want a full blown utility of this type, I suggest getting the Eudora
- Notify Kit which can be obtained via anonymous ftp from:
-
- <ftp://gaea.kgs.ukans.edu/applescript>
-
- What you need (i.e. what I cheated with)
-
- The following OSAXen are needed to use HQ and Nikita. All of them are from Greg Quinn's
- GTQLib OSAX Library. Thanks to Greg for letting me include them with the kit. Place all of
- the Scripting Additions in:
-
- System Folder:Extensions:Scripting Additions:
-
- You can obtain the entire kit by writing to me or preferably via anonymous ftp from:
-
- <ftp://gaea.kgs.ukans.edu/applescript/OSAXEN>
-
- In addition, you need to have the scriptable Finder.
-
- Whats coming
-
- Improved filtering algorithms and user settable preferences to improve speed. I recognize
- that speed is of essence in such operations and that rebecca fails as well as all other Applescript
- based solutions due. Although, some of this can be blamed on Applescripts lack of speed. A
- fair amount of blame can be placed with use the scriptors who don't write efficient enough
- AppleScript. Therefore, I will be spending alot of time on the aforementioned changes.
- In addition, a Scripting Addition (osax) version of rebecca will be made available which
- will also greatly increase speed. After these changes have been made, look for MacPerl, MacTCL,
- and Frontier version. Also, Zac Belado is going to write a Facespan version based on the final
- Nikita/HQ source code; Thanks Zac... I hate visual programming environments!!!
- And last but not least, the ever expensive C application that will pull it all together and kick
- it for speed. (Passing pointers instead of entire arrays will be a big plus all by itself) That of course
- will be shareware, $5-$10 as mentioned previously, but free to anyone who helps in the
- development process--that means you Greg and Zac.
- Enjoy!
- Sean
- Infant Software
- runt@inch.com
-
-
-
-
-
-